package sctu.edu.java.year2016.team05.xiongyihui.day20160522.chapter5_2;

/**
 * Created by 熊怡惠 on 2016/5/22.
 * 创建一维数组arr[]，将数组中最大值输出。
 */
public class two {
    public static void main(String[] args) {
        int[] num = {57, 89, 34, 26, 57, 66};
        System.out.println("输出一维数组：");
        for (int i = 0; i < num.length; i++) {
            System.out.print(num[i] + "");
        }
        int max = num[0];
        for (int j = 0; j < num.length - 1; j++) {
            if (max < num[j + 1]) {
                max = num[j + 1];
            }
        }
        System.out.println("\n一维数组的最大值是：" + max);
    }
}
